<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<script type="text/javascript">
	$(function() {
		parent.$.messager.progress('close');
		
		var firstWeight = '${expressFee.firstWeight}';
		
		if(firstWeight != '') {
			$('#showFirstWeight').val(firstWeight/1000);
		}
		
		var firstWeightFee = '${expressFee.firstWeightFee}';
		
		if(firstWeightFee != '') {
			$('#showFirstWeightFee').val(firstWeightFee/100);
		}
		
		var addedWeightFee = '${expressFee.addedWeightFee}';
		
		if(addedWeightFee != '') {
			$('#showAddedWeightFee').val(addedWeightFee/100);
		}
		
		$('#form').form({
			url : '/expressFeeController/edit',
			onSubmit : function() {
				
				if($("#showFirstWeight").val() != null ) {
					$("#firstWeight").val($("#showFirstWeight").val()*1000);
				}
				if($("#showFirstWeightFee").val() != null ) {
					$("#firstWeightFee").val($("#showFirstWeightFee").val()*100);
				}
				if($("#showAddedWeightFee").val() != null ) {
					$("#addedWeightFee").val($("#showAddedWeightFee").val()*100);
				}
				
				parent.$.messager.progress({
					title : '提示',
					text : '数据处理中，请稍后....'
				});
				var isValid = $(this).form('validate');
				if (!isValid) {
					parent.$.messager.progress('close');
				}
				return isValid;
			},
			success : function(result) {
				parent.$.messager.progress('close');
				result = $.parseJSON(result);
				parent.$.messager.alert("提示",result.msg, 'info');
				if (result.success) {
					parent.$.modalDialog.openner_dataGrid.datagrid('reload');
					parent.$.modalDialog.handler.dialog('close');
				}
			}
		});
	});
</script>
<div class="easyui-layout" data-options="fit:true,border:false">
	<div data-options="region:'center',border:false" title="" style="overflow: hidden;">
		<form id="form" method="post">
			<input name="id" type="hidden" value="${expressFee.id}" />
			<input type="hidden" name="expressId" value="${expressFee.expressId}">
			<input type="hidden" name="provinceId" value="${expressFee.provinceId}">
			<table class="table table-hover table-condensed">
				<tr>
					<td>区域</td>
					<td >
						<input type="text" value="${expressFee.provinceName}" style="width: 200px" />
					</td>
				</tr>
				<tr>
					<td>首重（千克）</td>
					<td >
						<input id="showFirstWeight" type="text" class="easyui-numberbox" precision="2" min="0" max="9999.99" value="0" style="width: 200px" />
						<input name="firstWeight" id="firstWeight" type="hidden" />
					</td>
				</tr>
				<tr>
					<td>首重价格（元）</td>
					<td >
						<input id="showFirstWeightFee" type="text" class="easyui-numberbox" precision="2" min="0" max="99999.99" value="0" style="width: 200px" />
						<input name="firstWeightFee" id="firstWeightFee" type="hidden" />
					</td>
				</tr>
				<tr>
					<td>续重价格（元/千克）</td>
					<td >
						<input id="showAddedWeightFee" type="text" class="easyui-numberbox" precision="2" min="0" max="99999.99" value="0" style="width: 200px" />
						<input name="addedWeightFee" id="addedWeightFee" type="hidden" />
					</td>
				</tr>
				<tr>
					<td>时效（天）</td>
					<td >
						<input name="aging" type="text" class="easyui-numberbox" min="0" max="999" style="width: 200px" value="${expressFee.aging}" />
					</td>
				</tr>
				<tr>
					<td>状态</td>
					<td >
						<input name="status" type="radio" value="1" ${(expressFee.status=='1')?'checked' : ''}/>可用
						<input name="status" type="radio" value="2" ${(expressFee.status=='2')?'checked' : ''}/>不可用
					</td>
				</tr>
			</table>
		</form>
	</div>
</div>